package com.client;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.util.List;

import com.model.PersonEntity;
import com.service.PersonService;

public class ProgramClient {
	public static void main(String[] args) {
		PersonService personService;
		try {
			personService = (PersonService) Naming.lookup("rmi://127.0.0.1:6600/PersonService");
			List<PersonEntity> personList=personService.getList();
			for(PersonEntity person:personList){
				System.out.println("ID:" + person.getId() + "Age:" + person.getAge()
				                   + "Name:" + person.getName());
			}
		} catch (MalformedURLException | RemoteException | NotBoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
